package package1;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class TestClass {
   
      public static void main(String[] args) {
         Date firstDate = new Date();
         
         Date secondDate = new Date();
         
         Calendar nowLast = Calendar.getInstance();
         nowLast.set( Calendar.DAY_OF_MONTH, 24 ); //24/05/2012
         nowLast.set( Calendar.YEAR, 2012 );
         nowLast.set( Calendar.MONTH, 01 );
        // nowLast.set(Calendar.HOUR, 0);
         //nowLast.set(Calendar.MINUTE, 0);
         //nowLast.set(Calendar.SECOND, 0);
         //nowLast.set(Calendar.MILLISECOND, 0);
         firstDate = nowLast.getTime();
         
         Calendar nowNext = Calendar.getInstance();
         nowNext.set( Calendar.DAY_OF_MONTH, 24 ); // 08/08/2012
         nowNext.set( Calendar.YEAR, 2012 );
         nowNext.set( Calendar.MONTH, 01 );
       //  nowNext.set(Calendar.HOUR, 0);
        // nowNext.set(Calendar.MINUTE, 0);
         //nowNext.set(Calendar.SECOND, 0);
         //nowNext.set(Calendar.MILLISECOND, 0);
         secondDate = nowNext.getTime();
         
         
       
      System.out.println("FirstDate:="+firstDate);
      
      
      System.out.println("SecondDate:="+secondDate);
     
      
      if(firstDate.after(secondDate))  
      System.out.println("Second Date is initialized before First Date ... ");
      else 
      System.out.println("Second Date is initialized after First Date ...");
      }
    }

